package cn.yangliu.nacos.comm.config;

import javax.persistence.EntityManager;

import cn.yangliu.nacos.comm.audit.JpaAuditor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;

/**
 * The type of nacos.
 *
 * @author 问道于盲
 * @date 2020 -01-01
 */
@Configuration
@ConditionalOnClass(EntityManager.class)
@EnableJpaAuditing
public class JpaAuditConfig {

    /**
     * Jpa auditor jpa auditor.
     *
     * @return the jpa auditor
     */
    @Bean
    public JpaAuditor jpaAuditor() {
        return new JpaAuditor();
    }

}
